@tabs-prefix-cls: ~"@{css-prefix}tabs";

.@{tabs-prefix-cls} {
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    color: @text-color;
    .clearfix();
    &-vertical{
        display: flex;
        height: 100%;
    }

    &-bar {
        outline: none;
    }

    &-ink-bar {
        height: 2px;
        box-sizing: border-box;
        background-color: @primary-color;
        position: absolute;
        left: 0;
        bottom: 1px;
        z-index: 1;
        transition: transform .3s @ease-in-out;
        transform-origin: 0 0;
    }

    &-bar:not(&-bar-vertical) {
        border-bottom: 1px solid @border-color-base;
        margin-bottom: 16px;
    }

    &-bar-vertical {
        margin-right: 16px;
        border-right: 1px solid @border-color-base;
        width: max-content;
    }

    // &-bar {
    //     border-bottom: 1px solid @border-color-base;
    //     margin-bottom: 16px;
    // }

    &-nav-container {
        margin-bottom: -1px;
        line-height: @line-height-base;
        font-size: @font-size-base + 2px;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        position: relative;
        .clearfix();
    }

    &-nav-more {
      float: right;
    }

    &-nav-container:focus {
        outline: none;
        // .@{tabs-prefix-cls}-tab-focused {
        //     border-color: @link-hover-color !important;
        // }
    }

    &-nav-container-scrolling {
        padding-left: 32px;
        padding-right: 32px;
    }

    &-nav-wrap {
        overflow: hidden;
        margin-bottom: -1px;
    }

    &-nav-scroll {
        overflow: hidden;
        white-space: nowrap;

        &::after{
            position: absolute;
            content: "";
            box-shadow: inset -12px 0 8px -8px #dddddd;
            opacity: 0;
            transition: opacity .3s;
            z-index: 1;
            width: 0px;
            height: 100%;
            top:0;
            right: 45px;
        }
        &::before{
            position: absolute;
            content: "";
            box-shadow: inset 12px 0 8px -8px #dddddd;
            opacity: 0;
            transition: opacity .3s;
            z-index: 1;
            width: 0px;
            height: 100%;
            top:0;
            left: 0px;
        }
        &-arrow{
          margin:0 15px;
        }
    }


    &-nav-right{
        float: right;
        margin-left: 5px;
    }

    &-nav-prev, &-nav-next{
        width: 36px;
        text-align: center;
        position: absolute;
        line-height: 36px;
        cursor: pointer;
        i{
            font-size: 16px;
        }
    }

    &-nav-prev{
        left: -10px;
    }

    &-nav-next{
        right: -10px;
    }

    &-nav-scrollable{
        // padding: 0 32px;
        // padding-right: 32px;
    }

    &-nav-scroll-disabled{
        // display: none;
        color: @color-brand-disabled2;
        cursor: not-allowed;
    }

    &-nav {
        padding-left: 0;
        margin: 0;
        float: left;
        list-style: none;
        box-sizing: border-box;
        position: relative;
        transition: transform 0.5s @ease-in-out;

        &:before,
        &:after {
            display: table;
            content: " ";
        }

        &:after {
            clear: both;
        }

        .@{tabs-prefix-cls}-tab-disabled {
            pointer-events: none;
            cursor: default;
            color:@color-complementary-6;
        }

        .@{tabs-prefix-cls}-tab {
            display: inline-block;
            height: 100%;
            padding: 8px 16px;
            margin-right: 16px;
            box-sizing: border-box;
            cursor: pointer;
            text-decoration: none;
            position: relative;
            transition: color .3s @ease-in-out;

            &:hover {
                color:@tabs-hover-color;
            }

            &:active {
                color: @link-active-color;
            }
            .@{css-prefix-iconfont} {
                width: 14px;
                height: 14px;
                margin-right: 8px;
            }
        }

        .@{tabs-prefix-cls}-tab-vertical{
            padding: 10px 20px;
            display: block;
            text-align: right;
            margin-right: 0px;
            border-right:2px solid transparent;
            z-index: 2;
            // min-width: 160px;
            &-nav-container:focus &-focused {
              border-left: 0px;
            }

            &.@{tabs-prefix-cls}-tab-text-left {
              text-align: left;
            }
        }

        .@{tabs-prefix-cls}-tab-active {
            color: @primary-color;
            &.@{tabs-prefix-cls}-tab-vertical {
                border-right: 2px solid @primary-color;
            }
        }
    }
    &-mini &-nav-container {
        font-size: @font-size-base;
    }

    &-mini &-tab {
        margin-right: 0;
        padding: 8px 16px;
        font-size: @font-size-small;
    }

    & {
        .@{tabs-prefix-cls}-content-animated {
            display: flex;
            flex-direction: row;
            will-change: transform;
            transition: transform .3s @ease-in-out;
        }

        .@{tabs-prefix-cls}-content-vertical {
            flex: 1;
        }

        .@{tabs-prefix-cls}-tabpane {
            flex-shrink: 0;
            width: 100%;
            transition: opacity .3s;
            opacity: 1;
            outline: none;
        }

        .@{tabs-prefix-cls}-tabpane-inactive {
            opacity: 0;
            height: 0;
        }
    }

    // line style
    &&-line > &-bar &-nav-scrollable-more {
        padding: 0px;
    }

    &&-line > &-bar &-nav-more {
        margin-left: 8px;
        margin-right: 5px;
        width: 24px;
        line-height: 26px;
        text-align: center;
        cursor: pointer;
        &:hover{
            color: @tabs-hover-color;
        }
    }

    &&-line > &-bar &-nav-scroll-after-shadow {
        &::after{
            width: 12px;
            opacity: 1;
            right: 30px;
        }
    }

    &&-line > &-bar &-nav-scroll-before-shadow {
        &::before{
            width: 12px;
            opacity: 1;
        }
    }

    // card style
    &&-card > &-bar {
        border-bottom: none;
    }

    &&-card > &-bar &-nav{
      border-bottom: 1px solid @border-color-base;
    }

    &&-card > &-bar &-nav-container {
        height: 41px;
    }

    &&-card > &-bar &-ink-bar {
        visibility: hidden;
    }

    &&-card > &-bar &-tab {
        margin: 0;
        margin-right: 5px;
        height: 40px;
        padding: 10px 20px;
        border: 1px solid @border-color-base;
        border-bottom: 0;
        border-radius: @btn-border-radius @btn-border-radius 0 0;
        transition: all 0.3s @ease-in-out;
        background: @tabs-card-bg;
    }

    &&-card > &-bar &-tab-active {
        height: 40px;
        padding-bottom: 5px;
        background: @color-bg-card;
        transform: translateZ(0);
        border-color: @border-color-base;
        color: @primary-color;
        position: relative;
        &:before{
          display: block;
          width: 100%;
          height: 1px;
          position: absolute;
          bottom: -1px;
          left: 0;
          background: #fff;
          content: '';
          z-index: 9;
        }
    }

    &&-card > &-bar &-nav-wrap {
        margin-bottom: 0;
    }

    &&-card > &-bar &-tab &-close {
        width: 14px;
        height: 14px;
        font-size: 14px;
        margin-right: 0;
        margin-left: 8px;
        color: @legend-color;
        text-align: right;
        vertical-align: middle;
        overflow: hidden;
        position: relative;
        top: -1px;
        transform-origin: 100% 50%;
        transition: all 0.3s @ease-in-out;
        &:hover {
            color: @primary-color;
        }
    }

    &&-card > &-bar &-nav-scrollable-more {
        padding: 0px;
    }

    &&-card > &-bar &-nav-more {
        width: 40px;
        height: 40px;
        line-height: 36px;
        margin: 0px;
        margin-left: 5px;
        border: 1px solid @border-color-base;
        border-bottom: 0;
        border-radius: @btn-border-radius @btn-border-radius 0 0;
        transition: all 0.3s @ease-in-out;
        background: @tabs-card-bg;
        text-align: center;
        cursor: pointer;
        &::before {
            display: block;
            position: relative;
            width: 100px;
            height: 1px;
            top: 39px;
            left: -10px;
            background: @border-color-base;
            content: '';
            z-index: 9;
        }
        &:hover {
            color: @tabs-hover-color;
        }
    }

    &&-card > &-bar &-nav-scroll-after-shadow {
        &::after{
            width: 12px;
            opacity: 1;
        }
    }

    &&-card > &-bar &-nav-scroll-before-shadow {
        &::before{
            width: 12px;
            opacity: 1;
        }
    }

    &&-card > &-bar &-tab-active &-close,
    &&-card > &-bar &-tab:hover &-close {
        width: 14px;
        transform: translateZ(0);
    }

    // 容器样式
    &&-container {
        background-color: @tabs-container-bg;
        padding: 20px;
    }

    &&-container > &-bar {
        border-bottom: none;
        margin-bottom: 0;
    }

    &&-container > &-bar &-nav-more {
        display: flex;
        height: 24px;
        justify-content: center;
        float: right;
        margin-left: 10px;
        width: 24px;
        margin-top: 7px;
        cursor: pointer;
        &:hover{
          background-color: #fff;
        }
    }

    &&-container > &-bar &-nav-scrollable-more {
        padding: 0;
    }

    &&-container > &-bar &-nav-scrollable &-nav-prev,
    &&-container > &-bar &-nav-scrollable &-nav-next {
        display: block;
        width: 24px;
        line-height: 24px;
        margin-top: 5px;
        text-align: center;
        &:hover:not(&-nav-click-disable) {
          background-color: #fff;
        }
    }

    &&-container > &-bar &-nav {
        border-bottom: none;
    }

    &&-container > &-bar &-nav-container {
        height: 41px;
    }

    &&-container > &-bar &-ink-bar {
        visibility: hidden;
    }

    &&-container > &-bar &-tab {
        margin: 0;
        margin-right: 5px;
        height: 40px;
        padding: 10px 20px 10px 20px;
        border: 0;
        border-radius: @border-radius-base @border-radius-base 0 0;
        background: @tabs-container-bg;
        color: @color-text-level3;
        position: relative;
        &:after {
            content: '';
            display: block;
            position: absolute;
            width: 1px;
            height: 20px;
            background-color: @tabs-container-gap;
            right: -1px;
            top: 50%;
            transform: translateY(-50%);
        }
        &:hover:not(.@{tabs-prefix-cls}-tab-active):not(.@{tabs-prefix-cls}-tab-active) {
            background-color: @tabs-container-hover-bg;
            // opacity: 0.6;
            // 遮挡前一个tab border
            &:after {
              width: 1px;
              left: -5px;
              background-color: @tabs-container-bg;
            }
        }
    }

    &&-container > &-bar &-tab-active {
        height: 40px;
        padding-bottom: 5px;
        background: @tabs-container-active-bg;
        transform: translateZ(0);
        color: @primary-color;
        position: relative;
        border-right: 0;
        &:before {
            display: block;
            width: 100%;
            height: 1px;
            position: absolute;
            bottom: -1px;
            left: 0;
            background: @tabs-container-active-bg;
            content: '';
            z-index: 9;
        }
        // 遮挡前一个tab border
        &:after {
            width: 1px;
            left: -5px;
            background-color: @tabs-container-bg;
        }
    }

    &&-container > &-bar &-nav-wrap {
        margin-bottom: 0;
    }

    &&-container > &-bar &-tab &-close {
        width: 14px;
        height: 14px;
        font-size: 14px;
        margin-right: 0;
        margin-left: 8px;
        color: @legend-color;
        text-align: right;
        vertical-align: middle;
        overflow: hidden;
        position: relative;
        top: -1px;
        transform-origin: 100% 50%;
        transition: all 0.3s @ease-in-out;
        &:hover {
            color: @primary-color;
        }
    }

    &&-container > &-bar &-tab-disabled {
        color: #bbbbbb;
        cursor: not-allowed;
    }

    &&-container > &-bar &-nav-scroll {
        &::after {
            right: 32px;
        }
    }
    &&-container > &-bar &-nav-scroll-after-shadow {
        &::after{
            width: 12px;
            opacity: 1;
        }
    }

    &&-container > &-bar &-nav-scroll-before-shadow {
        &::before{
            width: 12px;
            opacity: 1;
        }
    }

    &&-container &-content &-tabpane {
        background-color: #fff;
        padding: 16px 20px;
    }

    &-context-menu{
        position: absolute;
    }
}


.@{tabs-prefix-cls}-no-animation {
    > .@{tabs-prefix-cls}-content {
        transform: none!important;

        > .@{tabs-prefix-cls}-tabpane-inactive {
            display: none;
        }
    }
}
